﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Wiki.aspx.cs" Inherits="Admin_Wiki"
 MasterPageFile="~/Admin/MasterPage.master" EnableEventValidation="false" %>

<%@ Register Src="~/Admin/Controls/WikiSubCats.ascx" TagName="SubCats" TagPrefix="uc" %>

<asp:Content ContentPlaceHolderID="MainContent" runat="Server" ID="Content1">
<h1>Энциклопедия</h1>
    <div class="RegularBold">Page keywords</div>
<asp:TextBox runat="server" ID="txtKeywords"  Width="500px"></asp:TextBox>
<asp:Button ID="btnAddKeywords" runat="server" Text="Сохранить" OnClick="btnAddKeywords_Click"></asp:Button>
<br />
<img src="images/Delimiter.png" border="0" alt=""><br />
        <div class="content">
           <div class="RegularBold">Разделы</div>
            <div class="alefbetDiv" runat="server" dir="ltr" id="alefbetDiv">
                <div id="alefCatLIst" runat="server">
                </div>
            </div>
            <br />
            <asp:MultiView ID="MultiViewMain" runat="server">
                <asp:View ID="Categories" runat="server">
                <asp:Button ID="OpenAddCat" runat="server" text="Добавить новый раздел" OnClick="OpenAddCat_Click" />
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BorderStyle="None"
        DataKeyNames="catId" DataMember="CategoryItem" GridLines="None" ShowHeader="True" OnRowDataBound="GridView1_RowBound"
        Width="100%" >
        <RowStyle BorderStyle="None" />
        <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                    <div class="nathead">
                    <%--<div style="width:592px;"><%# ResoureManage.GetString("lableEnCyCategorys", "ru")%>:</div>--%>
                    <div style="width:592px;">Раздел</div>
                    <div style="width:105px;">Редактировать</div>
                    <div style="width:80px; background-image:none;">Удалить</div>
                    </div>
                    <div class="nathead2">
                        <div style="width:592px;"><%# Eval("cTitle") %></div>
                        <div style="width:105px;"><asp:Button ID="LinkButton1" runat="server" CausesValidation="True" 
                                                CommandArgument='<%# Eval("CatID") %>' UseSubmitBehavior="false" OnCommand="btnUpdateSubCat_Click" 
                                                Text="Изменить"></asp:Button></div>
                        <div style="width:80px;"> <asp:Button ID="lnkDeleteww" runat="server" CausesValidation="False" 
                                                    CommandArgument='<%# Eval("CatID") %>' UseSubmitBehavior="false" OnCommand="btnDeleteSubCat_Click" 
                                                    Text="Удалить"></asp:Button></div>
</div>
                    
                    
                        <uc:SubCats ID="SubCats1" runat="server" Ancestor='<%# Eval("catId") %>' />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
        </asp:TemplateField>
        <asp:TemplateField>
        <ItemTemplate></ItemTemplate>
        </asp:TemplateField>
        </Columns>
    </asp:GridView>
                </asp:View>
                    <asp:View ID="addCat" runat="server">
                    <div>
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td colspan="2">
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblCname" runat="server"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCatname" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                 <td>
                                    <asp:Label ID="lblPageName" runat="server"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPageName" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td valign="top" style="width:100px;">
                                    <asp:Label ID="lblSubDesc" runat="server"></asp:Label>
                                </td>
                                <td>
                                <asp:TextBox runat="server" ID="txtcDesc" Width="480px" Height="110px" TextMode="MultiLine"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnBack" runat="server" Text=" " OnClick="btnBack_Click" />
                                </td>
                                <td>
                                    <asp:Button ID="btnAddCat" runat="server" Text="Button" OnClick="btnAddCat_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </asp:View>
            </asp:MultiView>
        </div>
         <br /><img src="images/Delimiter.png" border="0" alt=""><br />
    <h2>Статьи</h2>
        <asp:GridView ID="gvNews" runat="server" AutoGenerateColumns="false" CssClass="SiteStats"
        AllowPaging="true" AlternatingRowStyle-CssClass="SiteStatsA" RowStyle-CssClass="SiteStats"
        Width="98%" AllowSorting="true" OnSorting="gvNews_Sorting" OnRowDataBound="gvNews_RowBound"
         PagerSettings-Visible="true"  PageSize="40" OnPageIndexChanging="gvNews_PageindexChanging">
        <Columns>
            <asp:BoundField DataField="PublishDate" SortExpression="Date" HeaderText="Дата" HeaderStyle-CssClass="StatsHeader"/>
            <asp:TemplateField HeaderText="Категория" HeaderStyle-CssClass="StatsHeader">
                <ItemTemplate>
                <asp:Label runat="server" ID="lblCat" Text='<%# (Eval("Parent").ToString()!="Энциклопедия")?Eval("Parent")+">"+Eval("cTitle"):Eval("cTitle") %>'></asp:Label>
                </ItemTemplate>
                </asp:TemplateField>
            <asp:BoundField DataField="Title" HeaderText="Статья" SortExpression="Title" HeaderStyle-CssClass="StatsHeader" />
                
            <asp:TemplateField HeaderText="Показывать на сайте" HeaderStyle-CssClass="StatsHeader">
                <ItemTemplate>
                <asp:CheckBox runat="server" ID="chkVisible" CommandArgument='<%# Eval("ArticleID") %>' AutoPostBack="true" OnCheckedChanged="chkVisible_Changed" Checked='<%# Eval("Isvisible") %>' />
                </ItemTemplate>
                </asp:TemplateField>
            <asp:BoundField DataField="Views" HeaderText="Просмотров" SortExpression="Views" HeaderStyle-CssClass="StatsHeader"/>
            <asp:TemplateField HeaderText="Действие" HeaderStyle-CssClass="StatsHeader">
            <ItemTemplate>
               <asp:Button OnCommand="btnDeleteNews_Click" CausesValidation="false" UseSubmitBehavior="false" CommandArgument='<%# Eval("ArticleID") %>'
                    Text='удалить' ID="btnDeleteNews" CssClass="but" runat="server"  />
              <asp:Button OnCommand="btnEditNews_Click" UseSubmitBehavior="false" CommandArgument='<%# Eval("ArticleID") %>'
                    Text="редактировать" runat="server" ID="btnEditNews" CssClass="but" />
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</asp:Content>
